/*-------------------------------- Arctic Core ------------------------------
 * Copyright (C) 2013, ArcCore AB, Sweden, www.arccore.com.
 * Contact: <contact@arccore.com>
 *
 * You may ONLY use this file:
 * 1)if you have a valid commercial ArcCore license and then in accordance with
 * the terms contained in the written license agreement between you and ArcCore,
 * or alternatively
 * 2)if you follow the terms found in GNU General Public License version 2 as
 * published by the Free Software Foundation and appearing in the file
 * LICENSE.GPL included in the packaging of this file or here
 * <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>
 *-------------------------------- Arctic Core -----------------------------*/


#ifndef CANNM_CONFIGTYPES_H_
#define CANNM_CONFIGTYPES_H_


/******************************************************************************
* Includes
******************************************************************************/
#include "CanTypes.h"


#define CANNM_UNUSED_CHANNEL 0xFFu


typedef enum {
	CANNM_PDU_BYTE_0	= 0x00,
	CANNM_PDU_BYTE_1	= 0x01,
	CANNM_PDU_OFF		= 0xFF
} CanNm_PduBytePositionType;



typedef struct {
	const uint8_t					NodeId;						/* Source Node ID */
	const uint32_t					MainFunctionPeriod;			/* ms */
	const uint32_t					TimeoutTime;				/* T[NM-Timeout] */
	const uint32_t					RepeatMessageTime;			/* T[Repeat Message] */
	const uint32_t					WaitBusSleepTime;			/* T[Wait Bus-Sleep] */
	const uint32_t					WaitBusSleepWakeUpTime;		/* T[Wait Bus-Sleep] */
	const uint32_t					MessageCycleTime;			/* T[Repeat NM Cycle] */
	const uint32_t					MessageCycleOffsetTime;		/* T[NM Cycle] */
	const uint32_t					MessageTimeoutTime;			/* T[Tx-Timeout] */
	const PduIdType					CanIfPduId;
	const uint8_t					PduLength;
	const CanNm_PduBytePositionType	NidPosition;
	const CanNm_PduBytePositionType	CbvPosition;
	const uint32_t					ImmediateNmCycleTime;
	const uint32_t					ImmediateNmTransmissions;
} CanNm_ConfigType;

#endif /* CANNM_CONFIGTYPES_H_ */


